﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ExportToRTR.CApExportToRTRStatusObjectIssueData
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands.ExportToRTR{

internal class CApExportToRTRStatusObjectIssueData : IEquatable<CApExportToRTRStatusObjectIssueData>
{
  private List<ITxObject> m_objectList = new List<ITxObject>();

  internal List<ITxObject> AllObjects => this.m_objectList;

  internal ITxObject MainObject
  {
    get => this.m_objectList.Count <= 0 ? (ITxObject) null : this.m_objectList[0];
  }

  internal CApExportToRTRStatusObjectIssueData(ITxObject mainObject = null, TxObjectList objects = null)
  {
    if (mainObject == null)
      return;
    this.m_objectList.Add(mainObject);
    if (objects == null)
      return;
    foreach (ITxObject itxObject in (Collection<ITxObject>) objects)
      this.m_objectList.Add(itxObject);
  }

  public bool Equals(CApExportToRTRStatusObjectIssueData other)
  {
    return (object) other != null && this.MainObject == other.MainObject;
  }

  public override bool Equals(object obj)
  {
    bool flag = false;
    if (obj != null)
    {
      if (obj is ITxObject itxObject)
      {
        flag = this.MainObject == itxObject;
      }
      else
      {
        CApExportToRTRStatusObjectIssueData other = obj as CApExportToRTRStatusObjectIssueData;
        if (other != (CApExportToRTRStatusObjectIssueData) null)
          flag = this.Equals(other);
      }
    }
    else
      flag = this.MainObject == null;
    return flag;
  }

  public override int GetHashCode() => this.MainObject != null ? this.MainObject.GetHashCode() : 0;

  public static bool operator ==(
    CApExportToRTRStatusObjectIssueData first,
    CApExportToRTRStatusObjectIssueData second)
  {
    return (object) first != null ? first.Equals(second) : (object) second == null;
  }

  public static bool operator !=(
    CApExportToRTRStatusObjectIssueData first,
    CApExportToRTRStatusObjectIssueData second)
  {
    return (object) first != null ? !first.Equals(second) : second != null;
  }
}
